package Test1;
/**
 *
 * @author 29284
 * @since 2024/11/29 20:42
 */
public class GameTest {
    public static void main(String[] args) {
        Role r1 = new Role("小猪乔治",100);
        Role r2 =new Role("小猪佩奇",100);
        int count=0;
        while(true){
            r1.attack(r2);
            count++;
            if (r2.getBlood()==0){
                System.out.println(r1.getRoleName()+"KO"+r2.getRoleName());
                break;
            }
            r2.attack(r1);
            count++;
            if (r2.getBlood()==0){
                System.out.println(r2.getRoleName()+"KO"+r1.getRoleName());
                break;
            }
        }
        System.out.println("共经历了"+count+"回合");
    }
}
